﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using CSP.Common.Tools;

namespace CSP.Web
{
    public partial class WebTest : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void BtnAttention_Click(object sender, EventArgs e)
        {
            string request = "";
            //关注
            string sinaWeiBoAttention = ConfigurationManager.AppSettings["SinaWeiBoAttention"].ToString();
            string uid = ConfigurationManager.AppSettings["SinaWeiBoUid"].ToString();
            request = sinaWeiBoAttention + "?uid=" + uid + "&access_token=" + TxtToken.Text.Trim();
            CommonTool.MakePostByUrlAndPostData(request, "post");

        }

        protected void BtnPublishWeiBo_Click(object sender, EventArgs e)
        {
            string request = "";
            //发布新浪微博
            string sinaWeiBoPublishInfo = ConfigurationManager.AppSettings["SinaWeiBoPublishInfo"].ToString();
            string marketingMsg = Server.UrlEncode(ConfigurationManager.AppSettings["MarketingMsg"].ToString());
            //request = sinaWeiBoPublishInfo + "?status=" + marketingMsg+"&access_token=" + accessToken ;
            request = "status=" + marketingMsg + "&access_token=" + TxtToken.Text.Trim();
            CommonTool.MakePostByUrlAndPostData(sinaWeiBoPublishInfo, request);
        }
    }
}